﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>AngularJS 表单</title>
    <script type="text/javascript" src="Scripts/angular.js"></script>
</head>
<body>
    <div ng-app="myApp" ng-controller="formCtrl">
        <form>
            First Name: <input type="text" ng-model="firstname">
        </form>
        <h1>你输入的内容为: {{firstname}}</h1>
        选中复选框，显示标题:
        <input type="checkbox" ng-model="myVar">
        <h1 ng-show="myVar">My Header</h1>
    </div>
    <script>
        var app = angular.module('myApp', []);
        app.controller('formCtrl', function ($scope) {
            $scope.firstname = "John";
        });
    </script>
</body>
</html>